import java.io.DataInputStream;
import java.io.IOException;


public class Utility {
	private static Integer serverPort=9999;
	private static Integer broadcastPort=443;
	private static String serverAddress="127.0.0.1";
	private static String nickName="";
	
	
	public static String getNickName() {
		return nickName;
	}
	public static void setNickName(String nickName) {
		Utility.nickName = nickName;
	}	
	public static String getServerAddress() {
		return serverAddress;
	}
	public static void setServerAddress(String serverAddress) {
		Utility.serverAddress = serverAddress;
	}
	public static Integer getServerPort() {
		return serverPort;
	}
	public static void setServerPort(Integer serverPort) {
		Utility.serverPort = serverPort;
	}
	public static Integer getBroadcastPort() {
		return broadcastPort;
	}
	public static void setBroadcastPort(Integer broadcastPort) {
		Utility.broadcastPort = broadcastPort;
	}
	
	public static String promptInput(String promptMsg){
		String result="";
		System.out.println(promptMsg);
		DataInputStream dis=new DataInputStream(System.in);
		
		try{
			result=dis.readLine();
		}catch(IOException e){
			e.printStackTrace();
		}
		
		return result;
	}
	
	public static void promptParameters(){
		String strServerPort=Utility.promptInput("Please enter port number:");		
		String strServerAddress=Utility.promptInput("Please enter your IP:");
		String strNickName=Utility.promptInput("Please enter your nick name:");
		
		Utility.setServerPort(Integer.parseInt(strServerPort));		
		Utility.setNickName(strNickName);				
		Utility.setServerAddress(strServerAddress);
		
	}
	
	
	
	
	

}
